package com.example.demo.service.impl;

import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import com.example.demo.service.BookService;

@Service
public class BookServiceImpl implements BookService{
	
	@Override
	@Cacheable(value="bookName",key="targetClass+'-'+method.name")
	public String getBookName() {
		System.out.println("call me one");
		return "三国演义";
	}

	@Override
	@CacheEvict(value="bookName",key="targetClass+'-getBookName'")
	public String clearBookname() {
		return "已清楚干净";
	}

}
